package com.cn.wanxi.servlet;

import com.cn.wanxi.io.CommonIO;
import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.model.NavModel;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/callus")
public class CallusServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        CompanyModel companyModel = new CompanyModel();
//        req.setAttribute("companyModel", companyModel);
//
//        NavModel navModel = new NavModel();//主要是用来取得数据
//        List<NavModel> navList = navModel.getNavList();
//        req.setAttribute("navList", navList);//这是导航数据
        CommonIO commonIO=new CommonIO();
        req.setAttribute("commonModelDto",commonIO.getFromCommon());

        req.getRequestDispatcher("/jsp/callus.jsp").forward(req, resp);//将值转发到页面去
    }
}
